<template>
    <div class="container">
        <div class="card">
            <span class="card__title">登 录</span>
            <p class="card__content">晨曦微露，愿你的每一天都如诗般绚烂，心灵如画般宁静</p>
            <el-form :model="form" style="max-width: 600px">
                <el-form-item>
                    <el-input v-model="form.name" placeholder="请输入邮箱" />
                </el-form-item>
                <el-form-item>
                    <el-button class="sign-up" @click="onSubmit">登 录</el-button>
                </el-form-item>
            </el-form>
        </div>
    </div>
</template>
<script lang="ts" setup>
import userApi from '@/api/login'
import { ref } from 'vue'

const form = ref({
    name: '',
})

const onSubmit = async () => {
    // console.log('submit!')
    const res = await userApi.login(form.value.name)
    console.log(res)
}
</script>
<style lang="scss" scoped>
@media (min-width: 1024px) {
    .container {
        min-height: 100vh;
        display: flex;
        align-items: center;
    }
}
.card {
    width: 100%;
    height: 254px;
    padding: 0 15px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 12px;
    background: #fff;
    border-radius: 20px;
}

.card > * {
    margin: 0;
}

.card__title {
    font-size: 23px;
    font-weight: 900;
    color: #333;
}

.card__content {
    font-size: 13px;
    line-height: 18px;
    color: #333;
}
</style>
